using UnityEngine;
using System.Collections;

[System.Serializable]
public class ToogleLight : MonoBehaviour {
	
	public Light lightToToggle;

	// Use this for initialization
	void Start () {
	}
	
	// Update is called once per frame
	void Update () {	
	}
	
	void OnTriggerStay (Collider other) {
        if (other.tag == "Player") {		
            if (Input.GetKeyUp("e")) {
               doLightToggle();
            }           
        }
    }
	
	void doLightToggle() {
		lightToToggle.enabled = !lightToToggle.enabled;
	}
}
